package com.jerry.base.io.read;

import org.junit.Test;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;

/**
 * User: Jerry
 * Date: 2024/1/26
 * Time: 21:42
 * Description:
 */
public class BufferedReaderUsage {

    @Test
    public void read() throws IOException {
        String filePath = "src/main/resources/io/chinese2.txt";
        try (BufferedReader bufferedReader = new BufferedReader(new FileReader(filePath))) {
            String line;
            while ((line = bufferedReader.readLine()) != null) {
                System.out.println(line);
            }
        }
    }

}
